package com.bawei.hfgc.databinding;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;

import com.bawei.hfgc.R;

public class DataBindingActivity extends AppCompatActivity implements View.OnClickListener {

    private Button bin1;
    private Button bin2;
    private Button bin3;
    private Button bin4;
    private Button bin5;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_data_binding);
        initView();
    }

    private void initView() {
        bin1 = (Button) findViewById(R.id.bin1);
        bin2 = (Button) findViewById(R.id.bin2);
        bin3 = (Button) findViewById(R.id.bin3);
        bin4 = (Button) findViewById(R.id.bin4);
        bin5 = (Button) findViewById(R.id.bin5);
        bin1.setOnClickListener(this::onClick);
        bin2.setOnClickListener(this::onClick);
        bin3.setOnClickListener(this::onClick);
        bin4.setOnClickListener(this::onClick);
        bin5.setOnClickListener(this::onClick);
    }

    @Override
    public void onClick(View v) {
        int id = v.getId();
        if (id==R.id.bin1){
            startActivity(new Intent(this,BasisActivity.class));
        }
         if (id==R.id.bin2){
             startActivity(new Intent(this,SingleActivity.class));

                }
         if (id==R.id.bin3){

                }
         if (id==R.id.bin4){

                }
         if (id==R.id.bin5){

                }

            }
}